﻿<baseview:BaseView x:Class="CharacterCreation.Views.SkillSelectionListView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:baseview="clr-namespace:CharacterCreation.Views.Contracts"             
    xmlns:controls="clr-namespace:CharacterCreation.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="2*" />
        </Grid.ColumnDefinitions>
        
        <controls:ListBox ItemsSource="{Binding Skills}" SelectedItem="{Binding CurrentSkill, Mode=TwoWay}" Background="Transparent" Grid.Column="0">
            <controls:ListBox.CustomItemTemplate>
                <DataTemplate>
                    <Border Background="AliceBlue" BorderBrush="LightGray" BorderThickness="1" CornerRadius="3">
                        <TextBlock Text="{Binding Name}" Margin="5" Foreground="Black"/>
                    </Border>
                </DataTemplate>
            </controls:ListBox.CustomItemTemplate>

            <controls:ListBox.SelectedItemTemplate>
                <DataTemplate>
                    <Border Background="AliceBlue" BorderBrush="{StaticResource backgroundBrush}" BorderThickness="1" CornerRadius="3">
                        <TextBlock Text="{Binding Name}" Margin="5" Foreground="Black"/>
                    </Border>
                </DataTemplate>
            </controls:ListBox.SelectedItemTemplate>
        </controls:ListBox>

        <Grid Grid.Column="1" Visibility="{Binding CurrentSkill, Converter={StaticResource visibilityConverter}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="Description" FontFamily="Georgia" FontSize="16" Foreground="{StaticResource backgroundBrush}" Margin="5" />
            <TextBlock Text="{Binding CurrentSkill.Description}" TextWrapping="Wrap" Grid.Row="1" Margin="5" />
        </Grid>
    </Grid>
</baseview:BaseView>
